<!--
 * @Description: 
 * @Autor: lds
 * @LastEditors: lds
-->
<!--  在需要的页面使用该组件：pinia-demo.vue,-->
<template>
    <div>{{ userStore.name }}</div>
    <button @click="handleChange">修改Pinia</button>
</template>

<script lang="ts" setup>
import { useUserStore } from '@/store/user';

const userStore = useUserStore();
//修改Pinia的state
const handleChange = () => {
    userStore.name = `"修改后的Pinia==>"${Date.now()};`;
};

// return {P
//   handleChange
// }
</script>

<style scoped></style>
